


const  login = code =>  {

	return new Promise((reject,resolve)=>{
		
		uni.request({
			url:getApp().globalData.baseUrl + '/wx/login',
			method:'POST',
			timeout:5000,
			header:{
				 'content-type': 'application/x-www-form-urlencoded'
			},
			data:{
				code:code
			},success:res=>{
				
				if(res.data.code == 20000){
					resolve(res.data)
				}else{
					reject(new Error(res.data.msg))
				}
				 
				 
			},fail:res=>{
				
				
				reject(new Error("获取数据失败"))
				
			}
			
		})
	})
	
}

module.exports = {
	login
	

}